package android.support.v4.media;

import android.graphics.Bitmap;
import android.net.Uri;
import android.os.Build.VERSION;
import android.os.Bundle;
import android.os.Parcel;
import android.os.Parcelable;
import android.os.Parcelable.Creator;
import android.support.v4.media.session.MediaSessionCompat;
import android.text.TextUtils;
import androidx.annotation.Nullable;
import o.p;
import o.p.e;
import o.s;
import o.s.a;

public final class MediaDescriptionCompat implements Parcelable {
    public static final Creator<MediaDescriptionCompat> CREATOR = new Creator<MediaDescriptionCompat>() {
        public /* synthetic */ Object createFromParcel(Parcel parcel) {
            return ˏ(parcel);
        }

        public /* synthetic */ Object[] newArray(int i) {
            return ˊ(i);
        }

        public MediaDescriptionCompat ˏ(Parcel parcel) {
            if (VERSION.SDK_INT < 21) {
                return new MediaDescriptionCompat(parcel);
            }
            return MediaDescriptionCompat.ˊ(p.ˏ(parcel));
        }

        public MediaDescriptionCompat[] ˊ(int i) {
            return new MediaDescriptionCompat[i];
        }
    };
    private final Uri ʻ;
    private final Uri ʼ;
    private final Bitmap ˊ;
    private final CharSequence ˋ;
    private final CharSequence ˎ;
    private final String ˏ;
    private final CharSequence ॱ;
    private Object ॱॱ;
    private final Bundle ᐝ;

    public static final class d {
        private Uri ʻ;
        private Uri ʽ;
        private CharSequence ˊ;
        private String ˋ;
        private CharSequence ˎ;
        private Bitmap ˏ;
        private CharSequence ॱ;
        private Bundle ᐝ;

        public d ˏ(@Nullable String str) {
            this.ˋ = str;
            return this;
        }

        public d ॱ(@Nullable CharSequence charSequence) {
            this.ˎ = charSequence;
            return this;
        }

        public d ˎ(@Nullable CharSequence charSequence) {
            this.ॱ = charSequence;
            return this;
        }

        public d ˏ(@Nullable CharSequence charSequence) {
            this.ˊ = charSequence;
            return this;
        }

        public d ˏ(@Nullable Bitmap bitmap) {
            this.ˏ = bitmap;
            return this;
        }

        public d ˋ(@Nullable Uri uri) {
            this.ʻ = uri;
            return this;
        }

        public d ˊ(@Nullable Bundle bundle) {
            this.ᐝ = bundle;
            return this;
        }

        public d ॱ(@Nullable Uri uri) {
            this.ʽ = uri;
            return this;
        }

        public MediaDescriptionCompat ˊ() {
            return new MediaDescriptionCompat(this.ˋ, this.ˎ, this.ॱ, this.ˊ, this.ˏ, this.ʻ, this.ᐝ, this.ʽ);
        }
    }

    MediaDescriptionCompat(String str, CharSequence charSequence, CharSequence charSequence2, CharSequence charSequence3, Bitmap bitmap, Uri uri, Bundle bundle, Uri uri2) {
        this.ˏ = str;
        this.ˎ = charSequence;
        this.ॱ = charSequence2;
        this.ˋ = charSequence3;
        this.ˊ = bitmap;
        this.ʼ = uri;
        this.ᐝ = bundle;
        this.ʻ = uri2;
    }

    MediaDescriptionCompat(Parcel parcel) {
        this.ˏ = parcel.readString();
        this.ˎ = (CharSequence) TextUtils.CHAR_SEQUENCE_CREATOR.createFromParcel(parcel);
        this.ॱ = (CharSequence) TextUtils.CHAR_SEQUENCE_CREATOR.createFromParcel(parcel);
        this.ˋ = (CharSequence) TextUtils.CHAR_SEQUENCE_CREATOR.createFromParcel(parcel);
        ClassLoader classLoader = getClass().getClassLoader();
        this.ˊ = (Bitmap) parcel.readParcelable(classLoader);
        this.ʼ = (Uri) parcel.readParcelable(classLoader);
        this.ᐝ = parcel.readBundle(classLoader);
        this.ʻ = (Uri) parcel.readParcelable(classLoader);
    }

    @Nullable
    public String ˎ() {
        return this.ˏ;
    }

    public int describeContents() {
        return 0;
    }

    public void writeToParcel(Parcel parcel, int i) {
        if (VERSION.SDK_INT < 21) {
            parcel.writeString(this.ˏ);
            TextUtils.writeToParcel(this.ˎ, parcel, i);
            TextUtils.writeToParcel(this.ॱ, parcel, i);
            TextUtils.writeToParcel(this.ˋ, parcel, i);
            parcel.writeParcelable(this.ˊ, i);
            parcel.writeParcelable(this.ʼ, i);
            parcel.writeBundle(this.ᐝ);
            parcel.writeParcelable(this.ʻ, i);
            return;
        }
        p.ˊ(ˊ(), parcel, i);
    }

    public String toString() {
        return this.ˎ + ", " + this.ॱ + ", " + this.ˋ;
    }

    public Object ˊ() {
        if (this.ॱॱ != null || VERSION.SDK_INT < 21) {
            return this.ॱॱ;
        }
        Object ˏ = e.ˏ();
        e.ˏ(ˏ, this.ˏ);
        e.ˎ(ˏ, this.ˎ);
        e.ˋ(ˏ, this.ॱ);
        e.ˊ(ˏ, this.ˋ);
        e.ˊ(ˏ, this.ˊ);
        e.ˋ(ˏ, this.ʼ);
        Bundle bundle = this.ᐝ;
        if (VERSION.SDK_INT < 23 && this.ʻ != null) {
            if (bundle == null) {
                bundle = new Bundle();
                bundle.putBoolean("android.support.v4.media.description.NULL_BUNDLE_FLAG", true);
            }
            bundle.putParcelable("android.support.v4.media.description.MEDIA_URI", this.ʻ);
        }
        e.ˏ(ˏ, bundle);
        if (VERSION.SDK_INT >= 23) {
            a.ˎ(ˏ, this.ʻ);
        }
        this.ॱॱ = e.ॱ(ˏ);
        return this.ॱॱ;
    }

    public static MediaDescriptionCompat ˊ(Object obj) {
        if (obj == null || VERSION.SDK_INT < 21) {
            return null;
        }
        Uri uri;
        Bundle bundle;
        MediaDescriptionCompat ˊ;
        d dVar = new d();
        dVar.ˏ(p.ˊ(obj));
        dVar.ॱ(p.ॱ(obj));
        dVar.ˎ(p.ˏ(obj));
        dVar.ˏ(p.ˋ(obj));
        dVar.ˏ(p.ˎ(obj));
        dVar.ˋ(p.ʻ(obj));
        Bundle ʽ = p.ʽ(obj);
        if (ʽ != null) {
            MediaSessionCompat.ˏ(ʽ);
            uri = (Uri) ʽ.getParcelable("android.support.v4.media.description.MEDIA_URI");
        } else {
            uri = null;
        }
        if (uri != null) {
            if (ʽ.containsKey("android.support.v4.media.description.NULL_BUNDLE_FLAG") && ʽ.size() == 2) {
                bundle = null;
                dVar.ˊ(bundle);
                if (uri != null) {
                    dVar.ॱ(uri);
                } else if (VERSION.SDK_INT >= 23) {
                    dVar.ॱ(s.ॱ(obj));
                }
                ˊ = dVar.ˊ();
                ˊ.ॱॱ = obj;
                return ˊ;
            }
            ʽ.remove("android.support.v4.media.description.MEDIA_URI");
            ʽ.remove("android.support.v4.media.description.NULL_BUNDLE_FLAG");
        }
        bundle = ʽ;
        dVar.ˊ(bundle);
        if (uri != null) {
            dVar.ॱ(uri);
        } else if (VERSION.SDK_INT >= 23) {
            dVar.ॱ(s.ॱ(obj));
        }
        ˊ = dVar.ˊ();
        ˊ.ॱॱ = obj;
        return ˊ;
    }
}
